package com.jxwifi.cloud.quickclean.adapter;

import android.support.annotation.LayoutRes;
import android.util.Log;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.jxwifi.cloud.quickclean.R;
import com.jxwifi.cloud.quickclean.bean.TagsBean;

public class PopAreaAdapter extends BaseQuickAdapter<TagsBean, BaseViewHolder> {

    private int mAreaindex;

    public PopAreaAdapter(@LayoutRes int layoutResId,int index){
        super(layoutResId,null);
        mAreaindex=index;
    }

    @Override
    protected void convert(BaseViewHolder helper, TagsBean item) {

        //shap_with_bg
        if (helper.getLayoutPosition()==mAreaindex){
            helper.setBackgroundRes(R.id.rel_area_list_item,R.drawable.shap_with_bg_un);
        }else{
            helper.setBackgroundRes(R.id.rel_area_list_item,R.drawable.shap_with_bg);
        }
        helper.setText(R.id.tv_pop_list_area,item.getArea());
        helper.setText(R.id.tv_pop_list_area_center,item.getDescription());

    }
}
